/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.rolgps.libnlink.database;

import java.util.Observable;
import java.util.Observer;
import org.rolgps.libnstack.exception.DatabaseException;
import org.rolgps.libnstack.message.DBMessage;
import org.rolgps.libnstack.protocol.KVDB;

/**
 *
 * @author xeph
 */
public class Simple implements KVDB, Observer{

    /**
     *
     * @param messenger
     */

    private String usr;
    private String passwd;
    private String content;
    private DBMessage requestMessage;

    /**
     *
     * @param usr
     * @param passwd
     * @throws org.rolgps.libnstack.exception.DatabaseException
     */
    public Simple(String usr, String passwd) throws DatabaseException {
        auth(usr, passwd);
    }


    public void auth(String usr, String passwd) throws DatabaseException {
        throw new UnsupportedOperationException("Not supported yet.");
    }


    public KVDB key(String key) {
        throw new UnsupportedOperationException("Not supported yet.");
    }


    public KVDB filter(String criteria) {
        throw new UnsupportedOperationException("Not supported yet.");
    }


    public boolean next() throws DatabaseException {
        throw new UnsupportedOperationException("Not supported yet.");
    }


    public String get() throws DatabaseException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void delete() throws DatabaseException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void add(String key, String value) throws DatabaseException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

 
    //Acá ocurre la magia para obtener los datos.
    /**
     *
     * @param arg0
     * @param arg1
     */
    public void update(Observable arg0, Object arg1) {
        if(arg1 instanceof DBMessage){
            DBMessage dBMessage = (DBMessage) arg1;
            
        }
    }

    public void update(String newValue) throws DatabaseException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void suscribe(String usr, String passwd) throws DatabaseException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
